package demo8;

public class Add extends Thread{
	static int sum;
	int sumPart;
	public Add(int sumPart) {
		super();
		this.sumPart = sumPart;
	}
	public Add() {
		super();
	}
	@Override
	public void run() {
		int sum=0;
		for(int i=0;i<10;i++){
			sum+=(sumPart+i);
		}
		add(sum);
	}
	public synchronized static void add(int num){
		sum+=num;
	}
}
